//!# Quick Start
//!```Rust
//!use log::debug;
//!use log4rs;
//!use std::time::Instant;
//!
//!use async_trait::async_trait;
//!use component::response::Response;
//!use component::ParseResult;
//!use engine::Engine;
//!use pipeline::ConsolePipeline;
//!use spider::Spider;
//!use std::sync::Arc;
//!
//!struct HttpbinSpider {
//!    start_urls: Vec<&'static str>,
//!}
//!
//!#[async_trait]
//!impl Spider for HttpbinSpider {
//!    type M = ();
//!    type ItemType = String;
//!    fn start_urls(&self) -> &[&'static str] {
//!        self.start_urls.as_slice()
//!    }
//!    async fn parse(
//!        &self,
//!        resp: Response,
//!        _meta: Option<Self::M>,
//!    ) -> ParseResult<Self::M, Self::ItemType> {
//!        let tasks = vec![];
//!        let mut items = vec![];
//!
//!        items.push(resp.resp.text().await.unwrap());
//!
//!        ParseResult { tasks, items }
//!    }
//!}
//!
//!#[tokio::main]
//!async fn main() {
//!    let now = Instant::now();
//!    log4rs::init_file("config/log4rs.yml", Default::default()).unwrap();
//!
//!    let spider = HttpbinSpider {
//!        start_urls: vec![
//!            "http://httpbin.org/delay/3?id=1",
//!            "http://httpbin.org/delay/3?id=2",
//!            "http://httpbin.org/delay/3?id=3",
//!            "http://httpbin.org/delay/3?id=4",
//!            "http://httpbin.org/delay/3?id=5",
//!            "http://httpbin.org/delay/3?id=6",
//!            "http://httpbin.org/delay/3?id=7",
//!            "http://httpbin.org/delay/3?id=8",
//!            "http://httpbin.org/delay/3?id=9",
//!            "http://httpbin.org/delay/3?id=10",
//!            "http://httpbin.org/delay/3?id=11",
//!        ],
//!    };
//!    let console_pl = ConsolePipeline;
//!    let mut engine = Engine::new(
//!        6,
//!        Arc::new(spider),
//!        Arc::new(vec![tokio::sync::Mutex::new(Box::new(console_pl))]),
//!        Arc::new(vec![]),
//!    );
//!    engine.run().await;
//!    debug!("完成, 耗时 {} 毫秒", now.elapsed().as_millis());
//!}
//!```

pub mod component;
pub mod downloader;
pub mod engine;
pub mod middleware;
pub mod pipeline;
pub mod scheduler;
pub mod spider;

pub use crate::component::request::{Method, Request, RequestBody};
pub use crate::component::response::Response;
pub use crate::component::{ParseResult, Task};
pub use crate::engine::{Engine, EngineBuilder};
pub use crate::middleware::{DownloaderMiddleware, DownloaderMwErrResult, DownloaderMwResult};
pub use crate::pipeline::{ConsolePipeline, CsvPipeline, ItemProduct, Pipeline};
pub use crate::spider::Spider;
